package com.haixiaoke.service.impl;

import com.haixiaoke.common.utils.DateUtils;
import com.haixiaoke.domain.LockYltAccredit;
import com.haixiaoke.mapper.LockYltAccreditMapper;
import com.haixiaoke.service.ILockYltAccreditService;
import com.haixiaoke.vo.YltAuthVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 亚略特智能锁授权信息Service业务层处理
 *
 * @author qixi
 * @date 2023-06-02
 */
@Service
public class LockYltAccreditServiceImpl implements ILockYltAccreditService {
    @Autowired
    private LockYltAccreditMapper lockYltAccreditMapper;

    /**
     * 查询亚略特智能锁授权信息
     *
     * @param id 亚略特智能锁授权信息主键
     * @return 亚略特智能锁授权信息
     */
    @Override
    public LockYltAccredit selectLockYltAccreditById(Long id) {
        return lockYltAccreditMapper.selectLockYltAccreditById(id);
    }

    /**
     * 查询亚略特智能锁授权信息列表
     *
     * @param lockYltAccredit 亚略特智能锁授权信息
     * @return 亚略特智能锁授权信息
     */
    @Override
    public List<LockYltAccredit> selectLockYltAccreditList(LockYltAccredit lockYltAccredit) {
        return lockYltAccreditMapper.selectLockYltAccreditList(lockYltAccredit);
    }

    /**
     * 新增亚略特智能锁授权信息
     *
     * @param lockYltAccredit 亚略特智能锁授权信息
     * @return 结果
     */
    @Override
    public int insertLockYltAccredit(LockYltAccredit lockYltAccredit) {
        lockYltAccredit.setCreateTime(DateUtils.getNowDate());
        return lockYltAccreditMapper.insertLockYltAccredit(lockYltAccredit);
    }

    /**
     * 修改亚略特智能锁授权信息
     *
     * @param lockYltAccredit 亚略特智能锁授权信息
     * @return 结果
     */
    @Override
    public int updateLockYltAccredit(LockYltAccredit lockYltAccredit) {
        lockYltAccredit.setUpdateTime(DateUtils.getNowDate());
        return lockYltAccreditMapper.updateLockYltAccredit(lockYltAccredit);
    }

    /**
     * 批量删除亚略特智能锁授权信息
     *
     * @param ids 需要删除的亚略特智能锁授权信息主键
     * @return 结果
     */
    @Override
    public int deleteLockYltAccreditByIds(Long[] ids) {
        return lockYltAccreditMapper.deleteLockYltAccreditByIds(ids);
    }

    /**
     * 删除亚略特智能锁授权信息信息
     *
     * @param id 亚略特智能锁授权信息主键
     * @return 结果
     */
    @Override
    public int deleteLockYltAccreditById(Long id) {
        return lockYltAccreditMapper.deleteLockYltAccreditById(id);
    }


    @Override
    public YltAuthVo getYLTAuthInfoBySNAndIdentification(String sn,String identification) {
        return lockYltAccreditMapper.getYLTAuthInfo(sn,identification);
    }

    @Override
    public LockYltAccredit selectLockYltAccreditByLockSNAndIdentification(String sn, String identification) {
        return lockYltAccreditMapper.selectLockYltAccreditByLockSNAndIdentification(sn, identification);
    }

    @Override
    public int deleteLockYltAccreditByLockSN(String sn) {
        return lockYltAccreditMapper.deleteLockYltAccreditByLockSN(sn);
    }

    @Override
    public List<YltAuthVo> getYLTAuthInfoList(String sn) {
        return lockYltAccreditMapper.getYLTAuthInfoList(sn);
    }


}
